﻿using Autofac;
using AutofacDemo.IService;

namespace AutofacDemo.Common
{
    /// <summary>
    /// Autofac封装
    /// </summary>
    public static class AutofacExtensions
    {
        public static void AddAutofacDemoApiModule(this ContainerBuilder builder)
        {
            builder.RegisterType<UserService>().As<IUserService>().SingleInstance();
            builder .RegisterType <IocService>().As <IIocService>().InstancePerLifetimeScope();  
        }



    }
}
